<html>
  <head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body class="tundra">
	<script type="text/javascript" src="../lib/dojo/dojo/dojo.js.uncompressed.js"
		djConfig="isDebug: true, debugAtAllCosts: true, parseOnLoad: false, usePlainJson: true"></script>
	<style>
		@import "../lib/dojo/dijit/themes/tundra/tundra.css"; /* required when dijit */	
		@import "../src/rforms/view/resources/rforms.css";
	</style>
	<script type="text/javascript">
		dojo.registerModulePath("rforms","../../../src/rforms");
		dojo.registerModulePath("rdfjson","../../../src/rdfjson");

		dojo.require("rforms.apps.Experiment");		
		//A simple template showing a title and an creator in the form of a foaf:Person with a firstname and lastname.
		//The person being shown in a table format.
		templateSrc = {
			"root":{
				"type":"group",
				"content":[
					{
						"type":"text",
						"nodetype":"LANGUAGE_LITERAL",
						"property":"http://purl.org/dc/terms/title",
						"cardinality": {"min": 2, "pref": "4", "max": 5},
						"label":{"en":"Title"},
						"description":{"en":"A short title of the resource"}
	    			}, {
						"type":"group",
						"nodetype":"RESOURCE",
						"label":{"en":"Creator"},
						"property":"http://purl.org/dc/terms/creator",
						"cardinality": {"min": 0, "max": 5},
						"constraints":{"http://www.w3.org/TR/rdf-schema/type":"http://xmlns.com/foaf/0.1/Person"},
						"cls": ["rformsTable"],
						"content":[
							{
								"type":"text",
								"nodetype":"ONLY_LITERAL",
								"property":"http://xmlns.com/foaf/0.1/firstName",
								"label":{"en":"First name"}
							},{
								"type":"text",
								"nodetype":"ONLY_LITERAL",
								"property":"http://xmlns.com/foaf/0.1/surname",
								"label":{"en":"Surname"}
							}
						]
					}
				]
			}
		};
		
		//Simple rdfjson data, all triples are matched into the template.
		rdf = {
				"http://example.org/about" : {
			        "http://purl.org/dc/terms/title"   : [ { "value" : "Anna's Homepage", "type" : "literal", "lang" : "en" } ] ,
			        "http://purl.org/dc/terms/creator" : [ { "value" : "_:person", "type" : "bnode" } ]
			    } ,
			 
			    "_:person" : {
					"http://www.w3.org/TR/rdf-schema/type"	  : [ { "value" : "http://xmlns.com/foaf/0.1/Person", "type" : "uri"}],
			        "http://xmlns.com/foaf/0.1/firstName"     : [ { "value" : "Anna", "type" : "literal" } ] ,
			        "http://xmlns.com/foaf/0.1/surname"       : [ { "value" : "Wilder", "type" : "literal" } ]
			    }
			};

		dojo.addOnLoad(function() {
			var e = new rforms.apps.Experiment({templateObj: templateSrc, graphObj: rdf, hideTemplate: true}, "container");
			e.startup();
		});
	</script>
	<div style="width:100%;height:100%" id="container"></div>
  </body>
</html>